package com.ror.domain;

//玩家的角色，地主或农民
public enum Role {
    NOT_INIT("未选定",-1),
    FARMER("农民", 2),
    LORD("地主", 1),
    ;

    //角色名
    private final String name;
    //最多几个人同时选，-1代表无限制
    private final int maxCount;
    //已经有几个人选了
    public int count;

    Role(String name, int maxCount) {
        this.name = name;
        this.maxCount = maxCount;
    }

    @Override
    public String toString() {
        return this.name;
    }

    public boolean isFull() {
        return maxCount != -1 && count >= maxCount;
    }
}
